package com.ss.android.article.base.feature.detail2.a.c;

import com.ss.android.article.base.feature.detail2.widget.ProgressTextView;
import com.ss.android.article.base.feature.detail2.widget.ProgressTextView.Status;
import com.ss.android.common.download.DownloadShortInfo;
import com.ss.android.common.util.ToolUtils;

final class s implements Runnable {
    private final DetailAdVideoLayout e;
    private final long a;
    private final long b;
    private final int c;
    private final DownloadShortInfo d;

    s(DetailAdVideoLayout arg1, long arg2, long arg4, int arg6, DownloadShortInfo arg7) {
        this.e = arg1;
        this.a = arg2;
        this.b = arg4;
        this.c = arg6;
        this.d = arg7;

    }

    public final void run() {
        int v6 = 16;
        int v5 = 8;
        int v4 = 2;
        float v0 = (((float)this.a)) / (((float)this.b));
        if(this.c == 1) {
            this.e.a = v4;
            this.e.g.setStatus(ProgressTextView.Status.DOWNLOADING);
            this.e.g.setProgress(v0);
        }
        else if(this.c == v4) {
            this.e.a = 4;
            this.e.g.setStatus(ProgressTextView.Status.PAUSING);
            this.e.g.setProgress(v0);
        }
        else if(this.c == 3) {
            if(this.d.b == v6) {
                this.e.a = v6;
                this.e.g.setStatus(ProgressTextView.Status.FAILURE);
            }
            else if(this.d.b == v5) {
                if(ToolUtils.isAppInstalled(this.e.getContext(), this.e.e)) {
                    this.e.a = 32;
                    this.e.g.setStatus(Status.FINISH_OPEN);
                }
                else {
                    this.e.g.setStatus(Status.FINISH_INSTALL);
                    this.e.a = v5;
                }
            }
        }
    }
}

